package net.xju3_4.controller;

import net.xju3_4.common.framework.simplemvc.RequestMapping;
import net.xju3_4.common.utils.JSONUtil;
import net.xju3_4.common.utils.Result;
import net.xju3_4.entity.GoodsType;
import net.xju3_4.service.GoodsTypeService;
import net.xju3_4.service.impl.GoodsTypeServiceImpl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RequestMapping("/api/goodsType")
public class GoodsTypeController {

    GoodsTypeService goodsTypeService = new GoodsTypeServiceImpl();

    @RequestMapping("/list.do")
    public void list(HttpServletRequest request, HttpServletResponse response) {
        List<GoodsType> goodsTypes = goodsTypeService.list();
        JSONUtil.printByJSON(response, Result.success(goodsTypes));
    }

}
